is there a way to convert a user's doorsname to the system username using DXL? |
Re: doorsname to username You need "Manage User" powers, such as a DB Admin. Well, coding this quick I learned something new.
string GetSystemLoginName(string in_DoorsName)
{ // Get the System Login Name for the DoorsName
if (!isUser(in_DoorsName)) return("NoSuchUser")
if (getAdministratorName() == in_DoorsName)
{ // Asking about the super user Admin.
// Only that user can see its own User properties
User usrCurr = find()
UserClass uc = usrCurr.class
if (uc != administrator) return("CannotRead")
}
User usr = find(in_DoorsName)
ensureUserRecordLoaded(usr)
string SysName = usr.systemLoginName
return(SysName)
} // end GetSystemLoginName()
void Test(string in_DoorsName)
{
print "[" in_DoorsName"]\t has System Login name: [" (GetSystemLoginName(in_DoorsName)) "]\n"
}
Test("landalo")
Test("xxx")
Test("Administrator")
|
Re: doorsname to username llandale - Fri Feb 10 19:41:59 EST 2012 You need "Manage User" powers, such as a DB Admin. Well, coding this quick I learned something new.
string GetSystemLoginName(string in_DoorsName)
{ // Get the System Login Name for the DoorsName
if (!isUser(in_DoorsName)) return("NoSuchUser")
if (getAdministratorName() == in_DoorsName)
{ // Asking about the super user Admin.
// Only that user can see its own User properties
User usrCurr = find()
UserClass uc = usrCurr.class
if (uc != administrator) return("CannotRead")
}
User usr = find(in_DoorsName)
ensureUserRecordLoaded(usr)
string SysName = usr.systemLoginName
return(SysName)
} // end GetSystemLoginName()
void Test(string in_DoorsName)
{
print "[" in_DoorsName"]\t has System Login name: [" (GetSystemLoginName(in_DoorsName)) "]\n"
}
Test("landalo")
Test("xxx")
Test("Administrator")
|
Re: doorsname to username llandale - Fri Feb 10 19:41:59 EST 2012 You need "Manage User" powers, such as a DB Admin. Well, coding this quick I learned something new.
string GetSystemLoginName(string in_DoorsName)
{ // Get the System Login Name for the DoorsName
if (!isUser(in_DoorsName)) return("NoSuchUser")
if (getAdministratorName() == in_DoorsName)
{ // Asking about the super user Admin.
// Only that user can see its own User properties
User usrCurr = find()
UserClass uc = usrCurr.class
if (uc != administrator) return("CannotRead")
}
User usr = find(in_DoorsName)
ensureUserRecordLoaded(usr)
string SysName = usr.systemLoginName
return(SysName)
} // end GetSystemLoginName()
void Test(string in_DoorsName)
{
print "[" in_DoorsName"]\t has System Login name: [" (GetSystemLoginName(in_DoorsName)) "]\n"
}
Test("landalo")
Test("xxx")
Test("Administrator")
Louie, Not sure you'll see this all the way back in 2012, but thanks for answering this. My question is, how did you know that User.systemLoginName was a valid function? I was trying to do this same thing and even using Mathias' list of undocumented DOORS perms -- at least, the latest one I could find, which admittedly only covered through 9.2 -- gave me no solution. Do you just have a later version? |